﻿using System.Collections.Generic;
using SimpleServiceBus.Messages.Management.Monitoring;
using SimpleServiceBus.Persistence.Domain.Management.Repositories;

namespace SimpleServiceBus.Tests.Stubs
{
    public class TestStatusRepository : IEndpointStatusRepository
    {
        public List<EndpointStatusMessage> StatusList { get; set; }
        public List<EndpointStatusSummaryNotification> SummaryList { get; set; }

        public TestStatusRepository()
        {
            StatusList = new List<EndpointStatusMessage>();
            SummaryList = new List<EndpointStatusSummaryNotification>();
        }

        #region IEndpointStatusRepository Members

        
        #endregion

        public void AddEndpointStatus(EndpointStatusUpdateNotification status)
        {
            StatusList.Add(status);
        }

        public void AddEndpointError(EndpointErrorNotification error)
        {
            StatusList.Add(error);
        }

        public void UpdateEndpointOnlineStatus(EndpointOnlineNotification onlineNotification)
        {
            StatusList.Add(onlineNotification);
        }

        public void UpdateEndpointOfflineStatus(EndpointOfflineNotification offlineNotification)
        {
            StatusList.Add(offlineNotification);
        }

        public void UpdateEndpointExpiredStatus(EndpointStatusExpiredNotification expiredNotification)
        {
            StatusList.Add(expiredNotification);
        }

        public void UpdateStatusSummaries(EndpointStatusSummaryNotification summary)
        {
            SummaryList.Add(summary);
        }
    }
}